import 'dart:async';

import 'package:flutter/material.dart';

class Splash extends StatefulWidget {
  @override
  SplashPage createState() => SplashPage();
}

class SplashPage extends State<Splash> {
  late Timer _timer;
  startTime() async {
    _timer = Timer.periodic(const Duration(seconds: 3), (v) {
      _timer.cancel();
      Navigator.of(context).pushReplacementNamed('home');
    });
  }

  @override
  void initState() {
    super.initState();
    startTime();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Container(
        height: double.infinity,
        width: double.infinity,
        color: Colors.purple,
        child: SafeArea(
          child: Padding(
            padding: const EdgeInsets.only(top: 100),
            child: Column(
              children: const [
                Text(
                  "SPLASH",
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
